package com.learn.boot;

import com.learn.client.RPCConsumer;
import com.learn.service.IUserService;

/**
 * @program: rmi
 * @description
 * @author: luffy
 * @create: 2020-08-17 14:54
 */
public class ConsumerBoot {
    private static final String PROVIDER_NAME = "UserService#sayHello#";
    public static void main(String[] args) {
        //1.创建代理对象
        IUserService service =(IUserService) RPCConsumer.createProxy(IUserService.class);
        //2.循环给服务器写数据
        while (true) {
            String result = service.sayHello("你好");
            System.out.println("======");

            System.out.println(result);

            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
